import flask
import os

UPLOAD_FOLDER = './upload'

app = flask.Flask(__name__)


@app.post('/upload_file')
def upload_file():
    file = flask.request.files['file']
    filename = file.filename
    file.save(os.path.join(UPLOAD_FOLDER, filename))
    return f"http://{flask.request.host}/download/{filename}"


if __name__ == "__main__":
    app.run(host='0.0.0.0', port=8001)
